using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class NetLog_StringDataProc_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(NetLog.StringDataProc);
            args = new Type[]{typeof(huqiang.Communication.Msg)};
            method = type.GetMethod("Handle", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Handle_0);
            args = new Type[]{typeof(System.String)};
            method = type.GetMethod("Cmd", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Cmd_1);

            field = type.GetField("LuaAction", flag);
            app.RegisterCLRFieldGetter(field, get_LuaAction_0);
            app.RegisterCLRFieldSetter(field, set_LuaAction_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_LuaAction_0, AssignFromStack_LuaAction_0);
            field = type.GetField("Snaping", flag);
            app.RegisterCLRFieldGetter(field, get_Snaping_1);
            app.RegisterCLRFieldSetter(field, set_Snaping_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Snaping_1, AssignFromStack_Snaping_1);


            app.RegisterCLRCreateDefaultInstance(type, () => new NetLog.StringDataProc());
            app.RegisterCLRCreateArrayInstance(type, s => new NetLog.StringDataProc[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* Handle_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Communication.Msg @msg = (huqiang.Communication.Msg)typeof(huqiang.Communication.Msg).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            NetLog.StringDataProc.Handle(@msg);

            return __ret;
        }

        static StackObject* Cmd_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @cmd = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            NetLog.StringDataProc.Cmd(@cmd);

            return __ret;
        }


        static object get_LuaAction_0(ref object o)
        {
            return NetLog.StringDataProc.LuaAction;
        }

        static StackObject* CopyToStack_LuaAction_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = NetLog.StringDataProc.LuaAction;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_LuaAction_0(ref object o, object v)
        {
            NetLog.StringDataProc.LuaAction = (System.Action<System.String>)v;
        }

        static StackObject* AssignFromStack_LuaAction_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<System.String> @LuaAction = (System.Action<System.String>)typeof(System.Action<System.String>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            NetLog.StringDataProc.LuaAction = @LuaAction;
            return ptr_of_this_method;
        }

        static object get_Snaping_1(ref object o)
        {
            return NetLog.StringDataProc.Snaping;
        }

        static StackObject* CopyToStack_Snaping_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = NetLog.StringDataProc.Snaping;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_Snaping_1(ref object o, object v)
        {
            NetLog.StringDataProc.Snaping = (System.Boolean)v;
        }

        static StackObject* AssignFromStack_Snaping_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @Snaping = ptr_of_this_method->Value == 1;
            NetLog.StringDataProc.Snaping = @Snaping;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new NetLog.StringDataProc();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
